|
DX11 SET BUFFER MATRIX
Sets a matrix value in a buffer at the specified position.
Take note that only primitive data types (booleans, integers, unsigned integers and floats) can be used as elements in an array buffer. Because of this, you cannot use this function with an array buffer.
The four-argument version is only used by structured buffers; byte address buffers will ignore the offsetInElement argument.
A matrix is the same as writing four by four (sixteen) float values after each other. Corresponds to the HLSL data type float4x4.
Take note that a matrix is stored in row-major order on the CPU, while the GPU uses a column-major format!
When writing and reading matrixes to/from buffers the majority is automatically switched by transposing the matrix.
DX11 SET BUFFER MATRIX buffer, offset, [offsetInElement], matrix
buffer Dword The buffer to write the matrix value to.
offset Dword The offset within the buffer to write the value to. If called for a structured buffer or an array buffer, this corresponds to the element id to set. For a byte address buffer it is the offset in bytes from the beginning of the buffer. Note that byte address buffers can only be read from at 4-byte aligned addresses by the GPU.
[Optional] offsetInElement Dword The offset within the current struct of the given element. Only relevant for structured buffers to allow writing struct entries with multiple data types. Ignored for all other buffer types.
matrix Dword The matrix to write to the given position within the specified buffer.
This function does not return a value.
DIRECTCOMPUTE Functions Menu
DX11 Function Categories
|